//
//  NotifactionUtils.swift
//  YPush
//
//  Created by YMac on 2024/11/6.
//

import Foundation
import UserNotifications

internal class FQuVRthnSFQkdGBA {
    static func mkwazcRsjEoGGoaR(body: NSDictionary?, userInfo: [AnyHashable : Any]) {
        if body == nil { return }
        if !(cQvWbqepOvFiLmsn.yYHjAmhheGFNDIUq?.showNotificationWhenOnline ?? false) { return }
        UNUserNotificationCenter.current().getNotificationSettings { settings in
            if settings.authorizationStatus != .authorized { return }
            let title = body!["title"] as! String
            let content = body!["content"] as! String
            let notificationContent = UNMutableNotificationContent()
            notificationContent.title = title
            notificationContent.body = content
            notificationContent.userInfo = userInfo
            UNUserNotificationCenter.current().add(UNNotificationRequest(identifier: "YPUSH_Notification", content: notificationContent, trigger: UNTimeIntervalNotificationTrigger(timeInterval: 0, repeats: false))) { error in
                
            }
        }
    }
}
